package com.hss01248.dialog.config;

import ohos.app.Context;

import com.hss01248.dialog.ResourceTable;
import ohos.global.resource.NotExistException;
import ohos.global.resource.WrongTypeException;

import java.io.IOException;

/**
 * Created by Administrator on 2016/10/9.
 */
public class DefaultConfig {

    public static int iosBtnColor = ResourceTable.Color_dialogutil_ios_btntext_blue; // @ColorRes



    public static int lvItemTxtColor = ResourceTable.Color_dialogutil_text_item_33; //@ColorRes

    public static int mdBtnColor = ResourceTable .Color_dialogutil_ios_btntext_blue; // @ColorRes
    public static int mdBtnCancelColor = ResourceTable.Color_dialogutil_text_black_lighter;  //@ColorRes

    public static int titleTxtColor = ResourceTable.Color_dialogutil_text_title_11; //@ColorRes
    public static int msgTxtColor = ResourceTable.Color_dialogutil_text_title_11; //@ColorRes
    public static int inputTxtColor = ResourceTable.Color_dialogutil_text_input_44; //@ColorRes


    public static boolean cancelable = true;//默认可以点击后退键来dismiss对话框
    public static boolean outsideTouchable = false;//默认外部半透明处点击消失

    /**
     * 是否在点击按钮后自动消失
     * 针对有的情况下点击按钮/item拿到回调后,需要dialog不消失
     */
    public static boolean dismissAfterResultCallback = true;
    /**
     * 半透明遮罩
     */
    public static boolean dimBehind = true;
    /**
     * 是否使用带阴影的背景(以防有的手机无法显示后面的半透明遮罩,而与下方界面黏连)
     */
    public static boolean useTheShadowBg = true;

    public static int btnTxtSize = 14;// in sp
    public static int titleTxtSize = 17;
    public static int msgTxtSize = 14;
    public static int itemTxtSize = 14;
    public static int inputTxtSize = 14;


    public static CharSequence btnTxt1 ;
    public static CharSequence btnTxt2 ;

    public static CharSequence bottomTxt ;
    public static CharSequence loadingTxt ;
    public static CharSequence uploadingTxt ;
    public static CharSequence downloadingTxt ;

    public static final int TYPE_MD_LOADING = 1;
    public static final int TYPE_MD_ALERT = 2;
    public static final int TYPE_MD_SINGLE_CHOOSE = 3;
    public static final int TYPE_MD_MULTI_CHOOSE = 4;



    public static final int TYPE_IOS_HORIZONTAL = 5;
    public static final int TYPE_IOS_VERTICAL = 6;
    public static final int TYPE_IOS_BOTTOM = 7;
    public static final int TYPE_IOS_CENTER_LIST = 8;
    public static final int TYPE_IOS_INPUT = 9;

    public static final int TYPE_CUSTOM_VIEW =10;

    public static final int TYPE_BOTTOM_SHEET_CUSTOM =11;

    public static final int TYPE_BOTTOM_SHEET_LIST =12;

    public static final int TYPE_BOTTOM_SHEET_GRID =13;

    public static final int TYPE_IOS_LOADING = 14;

    public static final int TYPE_PROGRESS = 15;

    public static final int TYPE_MD_INPUT = 16;

    public static void initBtnTxt(Context context){
        try {
            btnTxt1 = context.getResourceManager().getElement(ResourceTable.String_dialogutil_btn_sure).getString();
            btnTxt2 = context.getResourceManager().getElement(ResourceTable.String_dialogutil_btn_cancel).getString();
            bottomTxt = context.getResourceManager().getElement(ResourceTable.String_dialogutil_btn_cancel).getString();
            loadingTxt = context.getResourceManager().getElement(ResourceTable.String_dialogutil_loading).getString();
            uploadingTxt = context.getResourceManager().getElement(ResourceTable.String_dialogutil_uploading).getString();
            downloadingTxt = context.getResourceManager().getElement(ResourceTable.String_dialogutil_downloading).getString();
        }
        catch (IOException e1)
        {
            e1.printStackTrace();
        }
        catch (NotExistException e2)
        {
            e2.printStackTrace();
        }
        catch (WrongTypeException e3)
        {
            e3.printStackTrace();
        }
    }





}
